from django.db import models
from myweb.members.models import Member
from myweb.interest.managers import InterestManager

class Category(models.Model):
    name = models.CharField(max_length=100)

    def __unicode__(self):
        return self.name

class Interest(models.Model):
    name = models.CharField(max_length=100)
    category = models.ForeignKey(Category)
    follows = models.ManyToManyField(Member)
    
    objects = InterestManager()

class Tag(models.Model):
    tag = models.CharField(max_length=100)
    
class Content(models.Model):
    
    url = models.URLField(max_length=1000)
    domain = models.CharField(max_length=100)
    views = models.IntegerField()
    thumnail = models.CharField(max_length=1000)
    interest = models.ForeignKey(Interest)    
class Like(models.Model):
    content = models.ForeignKey(Content)
    liker = models.ForeignKey(Member)
    comment = models.TextField(blank=True, null=True)
    likedate = models.DateTimeField()
    



class PersonalTag(models.Model):
    tag = models.ForeignKey(Tag)
    tagger = models.ForeignKey(Member)
    targer = models.ForeignKey(Like)
